﻿@{
    ViewBag.Title = "Index";
}

<div class="path one columns">Trouble</div>

<div class="slider"></div>

<div class="commentform">
    @using (Html.BeginForm("DoSearch", "Trouble", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {
        @Html.ValidationSummary(true)
        <input id="_key" name="_key" type="text" />
        <input class="button" id="Search_click" name="Search_click" type="submit" value="Search" />
        <br />
    }
</div>

<div class="slider"></div>
<div class="columns three-fourths">
    <div id="comments">
    <h2>4 Comments</h2>
    @foreach (var t_item in (IEnumerable<KnowledgeCommunity.Model.Trouble>)ViewData["TroubleList"])
    {
        <div class="comment">
            <div class="line"></div>
            <div class="image"><img src="@Url.Content("~/Content/images/user_2.png")" alt="user" /></div>
            <div class="commentcontent">
            <div class="date"> <a href="@Url.Action("Replay", "Trouble", new { id=t_item.Id})">Replay</a> @t_item.AddTime.ToShortTimeString() by @t_item.UserName </div>
            <p>@t_item.Content</p>
            </div>
        </div>
        foreach (var a_item in (IEnumerable<KnowledgeCommunity.Model.Answer>)ViewData["AnswerList"])
        {
            if (t_item.ShapeCode == a_item.ShapeCode)
            {
                <div class="replay">
                  <div class="line"></div>
                  <div class="image"><img src="@Url.Content("~/Content/images/user_1.png")" alt="user" /></div>
                  <div class="commentcontent">
                    <div class="date"> 
                       <a href="#">
                         <label style=" font-size:medium; color:Olive; font-weight:bold;">@Enum.GetName(typeof(KnowledgeCommunity.Service.Enum.AnswerClass), a_item.State)</label>
                       </a> 
                       @a_item.AddTime.ToShortTimeString() by @a_item.UserName 
                    </div>
                    <p>@a_item.Content</p>
                  </div>
                </div>
            }
        }
        
    }
    <div class="clear"></div>

    </div>

</div>



